<?php
class BranchesFForm extends BaseFormAdmin{
	public function configure(){
		$langs = SysLanguages::getAllLang();
		foreach($langs as $lang){
			$this->setWidget('name_'.$lang, new sfWidgetFormInputText(array(), array('class' => 'required hz-required')));
			$this->setValidator('name_'.$lang, new sfValidatorString(array('max_length' => 255, 'required' => false)));
			
			$this->setWidget('address_'.$lang, new sfWidgetFormInputText(array(), array('class' => 'required hz-required')));
			$this->setValidator('address_'.$lang, new sfValidatorString(array('max_length' => 255, 'required' => false)));
			
			$this->setWidget('description_'.$lang, new sfWidgetFormTextarea());
			$this->setValidator('description_'.$lang, new sfValidatorString(array('required' => false)));
		}
		
		$this->setWidget('email', new sfWidgetFormInputText(array(), array('class' => 'required hz-required hz-email')));
		$this->setValidator('email', new sfValidatorAnd(array(new sfValidatorString(array('max_length'=> 255)),
				new sfValidatorEmail(array(), array('invalid' => __('error_email_invalid')))
		)));
		
		$this->setWidget('phone_number', new sfWidgetFormInputText(array(), array('class' => 'required hz-required number', 'maxlength' => '20')));
		$this->setValidator('phone_number', new sfValidatorString(array('max_length'=> 20)));
		
		
		
		$this->setWidget('location_district_id', new sfWidgetFormInputHidden(array(), array()));
		$this->setValidator('location_district_id', new sfValidatorString(array('required' => false)));
		$this->setDefault('location_district_id', '-1');
		parent::configure();
	}
}
